package com.pgytesting.secondhandcar.controller.mcpuser;

import com.pgytesting.secondhandcar.model.McpUserInfo;
import com.pgytesting.secondhandcar.service.McpUserInfoService;
import com.pgytesting.secondhandcar.vo.ResponseMessage;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author : frosty0804@gmail.com
 * @version : v1.0
 * @projectName : secondhandcar
 * @className : UpdateMcpUserController
 * @description : TODO(修改信息controller)
 * @date : 2019/8/16 15:59
 */
@RestController
@RequestMapping("/user/update")
public class UpdateMcpUserController {

    @Resource
    McpUserInfoService mcpUserInfoService;

    /**
     * 修改绑定手机号
     *
     * @param mcpUserInfo 用户信息
     * @return
     */
    @RequestMapping(value = "/updatePhone", method = RequestMethod.POST)
    public ResponseMessage updatePhoneNumber(@RequestBody McpUserInfo mcpUserInfo) {
        return mcpUserInfoService.update(mcpUserInfo);
    }

    /**
     * 绑定身份证
     *
     * @param mcpUserInfo 用户信息实体
     * @return
     */
    @RequestMapping(value = "/userBinding", method = RequestMethod.POST)
    public ResponseMessage userInf(@RequestBody McpUserInfo mcpUserInfo) {
        return mcpUserInfoService.updateOtherInformation(mcpUserInfo);
    }


    /**
     * 绑定银行卡
     *
     * @param mcpUserInfo 用户信息实体
     * @return
     */
    @RequestMapping(value = "/tieCard", method = RequestMethod.POST)
    public ResponseMessage tieCard(@RequestBody McpUserInfo mcpUserInfo) {
        return mcpUserInfoService.bindingBankCard(mcpUserInfo);
    }

}
